#! /bin/sh

sleep 1
dev_path=/sys$1
state=`cat ${dev_path}/state`
if [ "$state"x != "config"x  ] ; then
UDC=`ls /sys/class/udc/| awk '{print $1}'`
echo $UDC > /sys/kernel/config/usb_gadget/g1/UDC
fi
